#include <cmath>
#include <iostream>
#include <queue>
using namespace std;

const int kMaxN = 1e3 + 10;

int a[kMaxN], b[kMaxN];

int main() {
  priority_queue<int> pq;
  int n, k1, k2;

  cin >> n >> k1 >> k2;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }

  for (int i = 0; i < n; i++) {
    pq.emplace(abs(a[i] - b[i]));
  }
  for (int i = 0; i < k1 + k2; i++) {
    int x = pq.top();

    pq.pop();
    pq.emplace(abs(x - 1));
  }

  long long ans = 0;
  for (; !pq.empty(); pq.pop()) {
    int x = pq.top();
    ans += (long long)x * x;
  }

  cout << ans << "\n";
  return 0;
}